<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/** @var \Magento\Captcha\Block\Captcha\DefaultCaptcha $block */

/** @var \Magento\Captcha\Model\DefaultModel $captcha */
$captcha = $block->getCaptchaModel();
?>
<div class="field captcha required" role="<?php echo $block->escapeHtmlAttr($block->getFormId())?>">
    <label for="captcha_<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?php echo $block->escapeHtml(__('Please type the letters below')) ?></span></label>
    <div class="control captcha">
        <input name="<?php echo $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?php echo $block->escapeHtmlAttr($block->getFormId())?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>" />
        <div class="nested">
            <div class="field captcha no-label"
                 data-captcha="<?php echo $block->escapeHtmlAttr($block->getFormId())?>"
                 id="captcha-container-<?php echo $block->escapeHtmlAttr($block->getFormId())?>"
                 data-mage-init='{"captcha":{"url": "<?php echo $block->escapeUrl($block->getRefreshUrl())?>",
                                            "imageLoader": "<?php echo $block->escapeUrl($block->getViewFileUrl('images/loader-2.gif')) ?>",
                                             "type": "<?php echo $block->escapeHtmlAttr($block->getFormId()) ?>"}}'>
                <div class="control captcha-image">
                    <img alt="<?php echo $block->escapeHtmlAttr(__('Please type the letters below')) ?>" class="captcha-img" height="<?php /* @noEscape */ echo (float) $block->getImgHeight() ?>" src="<?php echo $block->escapeUrl($captcha->getImgSrc()) ?>"/>
                    <button type="button" class="action reload captcha-reload" title="<?php echo $block->escapeHtmlAttr(__('Reload captcha')) ?>"><span><?php echo $block->escapeHtml(__('Reload captcha')) ?></span></button>
                </div>
            </div>
            <?php if ($captcha->isCaseSensitive()) :?>
                <div class="captcha-note note">
                    <?php echo $block->escapeHtml(__('<strong>Attention</strong>: Captcha is case sensitive.'), ['strong']) ?>
                </div>
            <?php endif; ?>
        </div>
    </div>
</div>
